package com.tenglong.map.controller;


import com.tenglong.map.pojo.SysAddr;
import com.tenglong.map.service.AddrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class AddrController {

    @Autowired
    private AddrService addrService;

    @RequestMapping("/map")
    public String addr(Model model) {
        List list = addrService.getAddress();
        model.addAttribute("list", list);
        return "addr";
    }
    @RequestMapping("/set")
    @ResponseBody
    public List<String> di(){
        List<String> list = addrService.getAddress();
        return list;
    }
}
